#include "observer.h"
#include <iostream>

using std::cout;
using std::cin;
using std::endl;

Observer::Observer(string name)
	:name_(name)
{}

Observer::~Observer()
{}

string Observer::GetName()
{
	return this->name_;
}

ConcreteObserverA::ConcreteObserverA(string name)
	:Observer(name)
{}

ConcreteObserverA::~ConcreteObserverA()
{}

void ConcreteObserverA::Update(Subject* subject)
{
	cout << this->name_ << "：接收到消息，进行处理-" << subject->GetState() << endl;
}

ConcreteObserverB::ConcreteObserverB(string name)
	:Observer(name)
{}

ConcreteObserverB::~ConcreteObserverB()
{}

void ConcreteObserverB::Update(Subject* subject)
{
	cout << this->name_ << "：接收到消息，进行处理-" << subject->GetState() << endl;
}